using System.Collections;
using System.Collections.Generic;
using UnityEngine;

// 控制金币朝向摄像机，以及碰撞后消失

public class Coin : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        this.transform.rotation = Camera.main.transform.rotation;
    }

    void OnTriggerEnter2D(Collider2D c)
    {
        if(this != null){
            GameObject.Destroy(this.gameObject);
        }
    }
}
